package game.players.cpu.opponent;

import com.uqbar.vainilla.appearances.Animation;
import com.uqbar.vainilla.appearances.Sprite;

import game.players.SoccerPlayer;
import game.players.states.PassingPlayer;

public class PassingCPUOppPlayer extends PassingPlayer {

	public PassingCPUOppPlayer(SoccerPlayer player, SoccerPlayer targetPlayer) {
		super(player, targetPlayer);
		
		player.setAppearance(new Animation(0.3,
			Sprite.fromImage("/images/goal3_pase3.png").crop(0, 1, 39, 65).scale(1.5).flipHorizontally(),
			Sprite.fromImage("/images/goal3_pase3.png").crop(52, 0, 47, 65).scale(1.5).flipHorizontally()
			));
		
	}
	
	@Override
	protected void changeToStationary() {
		this.getPlayer().setState(new WithoutBallStationaryCPUOpp(this.getPlayer()));
	}

	@Override
	public void loseTheBall() {
		this.getTimer().cancel();
		this.getPlayer().setState(new BeatenCPUOppPlayer(this.getPlayer(), this.isRight()));
	}
	
	@Override
	public boolean isRight() {
		return false;
	}



}
